/**
 * Nuxt.js 配置文件
 */

module.exports = {
  router: {
    linkActiveClass: 'active',
    // 自定义路由表规则
    extendRoutes (routes, resolve) {
      // 清除 Nuxt.js 基于 pages 目录默认生成的路由表规则
      routes.splice(0)

      routes.push(...[
        {
          path: '/',
          component: resolve(__dirname, 'pages/layouts/'),
          children: [
            {
              path: '', // 默认子路由
              name: 'index',
              component: resolve(__dirname, 'pages/index/')
            },
            {
              path: '/about',
              name: 'about',
              component: resolve(__dirname, 'pages/about/')
            }
          ]
        }
      ])
    }
  },

  server: {
    host: '0.0.0.0',
    port: 2000
  }
}
